<?php

namespace app\index\controller;

class One extends Base
{

    public function index($navid = null)
    {
//        $this->datas['cid'] = '';
        //要闻
        $list['yaowen'] = model('article')
            ->where($this->datas)
            ->where('cid',403)
            ->order('sort DESC,create_time deSC')->limit(13)->select();
        //事实新闻
        $list['shishi'] = db('Article')
            ->field('id,miaoshu,issue,title,image,cid')
            ->where('status', '1')
            ->where('cid', '314')
            ->order('sort DESC,create_time DESC')
            ->limit(13)
            ->select();
        //指导
        $list['zhidao'] = model('article')
            ->where($this->datas)
            ->where('cid',397)
            ->order('sort DESC,create_time deSC')->limit(10)->select();
        //法规
        $list['fagui'] = model('article')
            ->where($this->datas)
            ->where('cid',398)
            ->order('sort DESC,create_time deSC')->limit(10)->select();
        //管理
        $list['guanli'] = model('article')
            ->where($this->datas)
            ->where('cid',400)
            ->order('sort DESC,create_time deSC')->limit(10)->select();

//        $this->datas['top'] = '1';
//        $list['top'] = model('article')
//            ->where($this->datas)
//            ->where('cid',1)
//            ->order('update_time deSC')->limit(10)->select();

        $list['img'] = model('article')
            ->where($this->datas)
            ->where('cid',403)
//            ->where('top',1)
            ->where('image', '<>', '')
            ->order('sort DESC,create_time deSC')->limit(5)->select();

        $carousel = model('carousel')
            ->where($this->datas)
            ->order('sort deSC')
            ->limit(5)
            ->select();

        $this->assign([
            'carousel' => $carousel,
            'list' => $list,
        ]);

        return $this->fetch($this->template . $this->request->controller() . '.html');
    }


}

